package org.thingsboard.server.dao.schedulerEvent;

import com.google.common.util.concurrent.ListenableFuture;
import org.thingsboard.server.common.data.EntitySubtype;
import org.thingsboard.server.common.data.SchedulerEvent;
import org.thingsboard.server.common.data.SchedulerEventInfo;
import org.thingsboard.server.common.data.SchedulerEventStatus;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.SchedulerEventId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;

import java.util.List;

public interface SchedulerEventService {
    SchedulerEvent findSchedulerEventById(SchedulerEventId schedulerEventId);
    SchedulerEvent findSchedulerEventById(TenantId tenantId, SchedulerEventId schedulerEventId);
    SchedulerEventInfo findSchedulerEventInfoById(TenantId tenantId, SchedulerEventId schedulerEventId);
    SchedulerEvent saveSchedulerEvent(SchedulerEvent se);
    SchedulerEventInfo saveSchedulerEventInfo(SchedulerEventInfo schedulerEventInfo);
    PageData<SchedulerEventInfo>  findSchedulerEventInfosByTenantId(TenantId tenantId, PageLink pageLink);
    PageData<SchedulerEventInfo>  findSchedulerEventInfosByTenantIdAndCustomerId(TenantId tenantId, CustomerId customerId, PageLink pageLink);
    void deleteSchedulerEvent(TenantId tenantId, SchedulerEventId schedulerEventId);
    List<SchedulerEventInfo> findSchedulerEventInfosByStatus(SchedulerEventStatus running);
    ListenableFuture<List<EntitySubtype>> findSchedulerEventTypesByTenantId(TenantId tenantId);
}